import { SLookupPlayerReply } from "../../../../Message/Game/SLookupPlayerReply";
import { SArenaCrossPlayerInfo } from "../../../../Message/Public/SArenaCrossPlayerInfo";
import { SWrestlePlayerInfo } from "../../../../Message/Public/SWrestlePlayerInfo";
import { WuXingPlayerInfo } from "../../model/wuxing/WuXingPlayerInfo";
import { EquipmentUtil } from "../common/util/EquipmentUtil";
import { SAcupointInfo } from "../../../../Message/Game/SAcupointInfo";
import { SPublicMiniPlayer } from "../../../../Message/Public/SPublicMiniPlayer";
type int = number;
//class LookupPlayerData
    
    export  class LookupPlayerData
    {
        

        /* internal  */static clearMsg(): void
        {
            LookupPlayerData.data = null;
            LookupPlayerData.arenaCrossInfo = null;
            LookupPlayerData.wrestleInfo = null;
            return;
        }

        public static get lookupData(): SLookupPlayerReply
        {
            return LookupPlayerData.data;
        }

        public static get arenaCrossLookInfo(): SArenaCrossPlayerInfo
        {
            return LookupPlayerData.arenaCrossInfo;
        }

        public static get wrestleLookInfo(): SWrestlePlayerInfo
        {
            return LookupPlayerData.wrestleInfo;
        }

        public static set msg(arg1: SLookupPlayerReply)
        {
            LookupPlayerData.clearMsg();
            LookupPlayerData.data = arg1;
            LookupPlayerData.acupoint = arg1.acupointInfo;
            if (!LookupPlayerData.wxInfo) 
            {
                LookupPlayerData.wxInfo = new WuXingPlayerInfo();
            }
            LookupPlayerData.wxInfo.attrInfo = arg1.wuxingFightAttribute;
            LookupPlayerData.wxInfo.wuxingAttr = arg1.wuxingAttributes;
            var loc1=EquipmentUtil.setPlayerEequipArr(arg1.playerItemUpdates);
            LookupPlayerData.wxInfo.magicItemArr = EquipmentUtil.getMagicItemArr(arg1.playerAmuletItemUpdate);
            LookupPlayerData.wxInfo.allEquipItemArr = EquipmentUtil.getAllEquipItemArr(loc1);
            return;
        }

        public static set arenaCrossMsg(arg1: SArenaCrossPlayerInfo)
        {
            LookupPlayerData.clearMsg();
            LookupPlayerData.arenaCrossInfo = arg1;
            if (!LookupPlayerData.wxInfo) 
            {
                LookupPlayerData.wxInfo = new WuXingPlayerInfo();
            }
            LookupPlayerData.wxInfo.attrInfo = arg1.wuxing;
            LookupPlayerData.wxInfo.wuxingAttr = arg1.wuxingAttributes;
            var loc1=EquipmentUtil.setPlayerEequipArr(arg1.equips);
            LookupPlayerData.wxInfo.magicItemArr = EquipmentUtil.getMagicItemArr(arg1.playerAmuletItemUpdate);
            LookupPlayerData.wxInfo.allEquipItemArr = EquipmentUtil.getAllEquipItemArr(loc1);
            return;
        }

        public static set wrestleMsg(arg1: SWrestlePlayerInfo)
        {
            LookupPlayerData.clearMsg();
            LookupPlayerData.wrestleInfo = arg1;
            if (!LookupPlayerData.wxInfoWrestle) 
            {
                LookupPlayerData.wxInfoWrestle = new WuXingPlayerInfo();
            }
            LookupPlayerData.wxInfoWrestle.attrInfo = arg1.wuxing;
            LookupPlayerData.wxInfoWrestle.wuxingAttr = arg1.wuxingAttributes;
            var loc1=EquipmentUtil.setPlayerEequipArr(arg1.equips);
            LookupPlayerData.wxInfoWrestle.magicItemArr = EquipmentUtil.getMagicItemArr(arg1.playerAmuletItemUpdate);
            LookupPlayerData.wxInfoWrestle.allEquipItemArr = EquipmentUtil.getAllEquipItemArr(loc1);
            return;
        }

        public static get acupointInfo(): SAcupointInfo
        {
            return LookupPlayerData.acupoint;
        }

        public static get miniPlayer(): SPublicMiniPlayer
        {
            if (LookupPlayerData.data) 
            {
                return LookupPlayerData.data.miniPlayer;
            }
            if (LookupPlayerData.arenaCrossInfo) 
            {
                return LookupPlayerData.arenaCrossInfo.miniPlayer;
            }
            if (LookupPlayerData.wrestleInfo) 
            {
                return LookupPlayerData.wrestleInfo.miniPlayer;
            }
            return null;
        }

        public static getRootBreakThroughsLevelByStep(arg1: int): int
        {
            var loc1=0;
            var loc2=acupointInfo.rootBreakThroughs;
            if (loc2) 
            {
                loc1 = loc2[arg1];
            }
            if (loc1 == 0) 
            {
                loc1 = 100;
            }
            return loc1;
        }

        public static get wuxingInfo(): WuXingPlayerInfo
        {
            return LookupPlayerData.wxInfo;
        }

        public static get wuxingInfoWrestle(): WuXingPlayerInfo
        {
            return LookupPlayerData.wxInfoWrestle;
        }

        public static get level(): int
        {
            if (LookupPlayerData.data && miniPlayer) 
            {
                return miniPlayer.level;
            }
            if (LookupPlayerData.arenaCrossInfo) 
            {
                return LookupPlayerData.arenaCrossInfo.miniPlayer.level;
            }
            if (LookupPlayerData.wrestleInfo) 
            {
                return LookupPlayerData.wrestleInfo.miniPlayer.level;
            }
            return 0;
        }

        /* internal */ static /* var */wrestleInfo: SWrestlePlayerInfo;

        /* internal */ static /* var */arenaCrossInfo: SArenaCrossPlayerInfo;

        /* internal */ static /* var */data: SLookupPlayerReply;

        /* internal */ static /* var */acupoint: SAcupointInfo;

        /* internal */ static /* var */wxInfo: WuXingPlayerInfo;

        /* internal */ static /* var */wxInfoWrestle: WuXingPlayerInfo;
    }
